package com.winshare.saleAssistant.mapper;

import com.winshare.saleAssistant.domain.dto.req.BaseIdDTO;
import com.winshare.saleAssistant.domain.dto.req.MaterialCreateDTO;
import com.winshare.saleAssistant.domain.dto.req.MaterialQueryDTO;
import com.winshare.saleAssistant.domain.dto.req.MaterialUpdateDTO;
import com.winshare.saleAssistant.domain.dto.resp.MaterialRespDTO;
import com.winshare.saleAssistant.domain.entity.MaterialDO;
import com.winshare.saleAssistant.domain.query.MaterialQuery;
import org.mapstruct.Mapper;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface MaterialMapStruct {

    MaterialMapStruct INSTANCE = Mappers.getMapper(MaterialMapStruct.class);

    MaterialDO fromMaterialCreateDTO(MaterialCreateDTO materialCreateDTO);

    MaterialDO fromMaterialUpdateDTO(MaterialUpdateDTO materialUpdateDTO);

    MaterialDO fromBaseIdDTO(BaseIdDTO baseIdDTO);

    MaterialRespDTO fromMaterialDO(MaterialDO materialDOInSql);

    MaterialQuery fromMaterialQueryDTO(MaterialQueryDTO materialQueryDTO);

    List<MaterialRespDTO> fromMaterialDOList(List<MaterialDO> materialDOList);
}
